Skip to content

feat: UX enhancements in HR & Payroll navigation & list views#4212

Open
krishna-254 wants to merge 2 commits intofrappe:developfrom
krishna-254:feat/employee-creation-and-lifecycle
Open

feat: UX enhancements in HR & Payroll navigation & list views#4212
krishna-254 wants to merge 2 commits intofrappe:developfrom
krishna-254:feat/employee-creation-and-lifecycle

Conversation

@krishna-254
Copy link
Contributor

@krishna-254 krishna-254 commented Mar 10, 2026

Part of #4091

Changes

  • Renamed people to setup
  • Added Employment Type in list view
  • Added Overtime Slip, Arrear and Payroll Correction
  • patch for renaming people to setup

Summary by CodeRabbit

  • New Features

    • Added Overtime Slip, Arrear, and Payroll Correction to the Payroll dashboard
    • Employment Type now visible in Employee list view
  • Chores

    • Renamed navigation and desktop icon label from "People" to "Setup"
    • Added a migration patch to clean up legacy "People" entries and update navigation links

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2026

Walkthrough

Renames navigation and UI labels from "People" to "Setup" across multiple JSON configuration files (desktop icon, workspace, workspace sidebar). Adds three dashboard items under Payroll: "Overtime Slip", "Arrear", and "Payroll Correction". Introduces a patch script that deletes existing "People" documents for doctypes "Workspace Sidebar", "Workspace", and "Desktop Icon" and clears the cache; registers the patch in hrms/patches.txt. Enables in_list_view: 1 for the Employee doctype's employment_type field. Modified timestamps updated where applicable.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions 'HR & Payroll navigation & list views' enhancements, which partially aligns with the changes (People→Setup rename and Employment Type list view), but understates the significant migration work including the patch script and broader workspace restructuring.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
hrms/setup.py (1)

183-190: ⚠️ Potential issue | 🟠 Major

Backfill this list-view change for upgraded sites.

If this feature is expected on existing sites too, this change alone only covers fresh installs: get_custom_fields() is applied from after_install() on Line 15. Upgrades need a patch that updates the existing employment_type custom-field metadata and clears the Employee cache.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@hrms/setup.py` around lines 183 - 190, Add an upgrade patch (separate from
after_install() where get_custom_fields() runs only on fresh installs) that
updates the existing Employee custom field "employment_type" to match the new
metadata (fieldtype Link, options "Employment Type", label _("Employment Type"),
insert_after "department", in_list_view 1, ignore_user_permissions 1) and then
clear the Employee doctype cache so changes take effect; locate the custom field
by fieldname "employment_type" on doctype "Employee", update its properties,
save it (or use the framework's update API), and call the cache-clearing routine
for Employee so upgraded sites get the new list-view behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@hrms/patches/v16_0/rename_people_to_setup.py`:
- Around line 4-9: Add the patch module
hrms.patches.v16_0.rename_people_to_setup to the post_model_sync list in
hrms/patches.txt so the execute() function in that module runs during migration;
open hrms/patches.txt and append "hrms.patches.v16_0.rename_people_to_setup"
(matching the module name) in the post_model_sync section of the file.

---

Outside diff comments:
In `@hrms/setup.py`:
- Around line 183-190: Add an upgrade patch (separate from after_install() where
get_custom_fields() runs only on fresh installs) that updates the existing
Employee custom field "employment_type" to match the new metadata (fieldtype
Link, options "Employment Type", label _("Employment Type"), insert_after
"department", in_list_view 1, ignore_user_permissions 1) and then clear the
Employee doctype cache so changes take effect; locate the custom field by
fieldname "employment_type" on doctype "Employee", update its properties, save
it (or use the framework's update API), and call the cache-clearing routine for
Employee so upgraded sites get the new list-view behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5ffefc54-025f-4528-8331-8e4b6e69a9e5

📥 Commits

Reviewing files that changed from the base of the PR and between c09ae04 and bce61d1.

⛔ Files ignored due to path filters (2)
  • hrms/public/icons/desktop_icons/setup.svg is excluded by !**/*.svg
  • hrms/public/icons/desktop_icons/solid/setup.svg is excluded by !**/*.svg
📒 Files selected for processing (6)
  • hrms/desktop_icon/setup.json
  • hrms/hr/workspace/setup/setup.json
  • hrms/overrides/dashboard_overrides.py
  • hrms/patches/v16_0/rename_people_to_setup.py
  • hrms/setup.py
  • hrms/workspace_sidebar/setup.json

@krishna-254 krishna-254 force-pushed the feat/employee-creation-and-lifecycle branch from bce61d1 to f84166c Compare March 10, 2026 18:00
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@hrms/patches/v16_0/rename_people_to_setup.py`:
- Around line 5-7: The current loop deletes any document named "People" which is
destructive; instead, detect only the shipped/global records named "People" and
rename them in-place to "Setup". In the loop over ("Workspace
Sidebar","Workspace","Desktop Icon") replace the frappe.delete_doc call with
logic that: 1) verifies the record exists and is a shipped/global record (e.g.
frappe.db.get_value(doctype, "People", ["owner", "is_custom"]) and ensure owner
== "Administrator" and is_custom is not truthy, or use any project-specific flag
that marks a standard record), and 2) calls frappe.rename_doc(doctype, "People",
"Setup", ignore_permissions=True, force=True) (or frappe.db.set_value/rename
equivalent) only when that check passes so site-specific or custom "People" rows
are not removed. Ensure you keep the existing loop and checks around
frappe.db.exists/frappe.delete_doc and replace the delete with the scoped
renaming logic.
- Around line 4-9: The migration currently deletes "People" in execute() for
doctypes ("Workspace Sidebar", "Workspace", "Desktop Icon") but does not ensure
the replacement "Setup" records are recreated on upgrade; inspect hrms/hooks.py
for fixtures or sync declarations covering hrms/hr/workspace/setup/setup.json,
hrms/workspace_sidebar/setup.json, and hrms/desktop_icon/setup.json and if
missing either add those files to the app's fixtures/sync path or add a
migration step that explicitly creates the three "Setup" records (for doctypes
Workspace Sidebar, Workspace, Desktop Icon) after deletion so upgraded sites
receive the navigation entries; reference the execute() function and the three
JSON files in your changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c31d923e-8762-4989-8512-bdee8e263900

📥 Commits

Reviewing files that changed from the base of the PR and between bce61d1 and f84166c.

⛔ Files ignored due to path filters (2)
  • hrms/public/icons/desktop_icons/setup.svg is excluded by !**/*.svg
  • hrms/public/icons/desktop_icons/solid/setup.svg is excluded by !**/*.svg
📒 Files selected for processing (5)
  • hrms/desktop_icon/setup.json
  • hrms/hr/workspace/setup/setup.json
  • hrms/patches.txt
  • hrms/patches/v16_0/rename_people_to_setup.py
  • hrms/workspace_sidebar/setup.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • hrms/workspace_sidebar/setup.json

Copy link
Member

@asmitahase asmitahase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@asmitahase
Copy link
Member

Approved, rebase and merge

@ruchamahabal
Copy link
Member

Isn’t “setup” going to conflict with other module setups as we discussed during the ux session?

@asmitahase
Copy link
Member

#4091 This still has that point mentioned, so I thought we agreed on the name

@ruchamahabal
Copy link
Member

ruchamahabal commented Mar 11, 2026

I think we were looking for a way to name it HR Setup and keeping the title as Setup but framework doesn’t support it. Wasn’t captured in the notes

@ruchamahabal
Copy link
Member

ruchamahabal commented Mar 11, 2026

Accounts has “Accounts Setup”
Should we call this “HR Setup” then?

@ruchamahabal ruchamahabal changed the title Feat: employee creation and lifecycle feat: UX enhancements in HR & Payroll navigation & list views Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants